﻿@model PasswordRecoveryModel
@using SpotsHub.Gateway.Models.Customer;

<div class="window">
    <div class="window-title grad-lightgrey grad">
        <div class="window-title-bar grad-titleshine grad">
            <h2>@T("Account.PasswordRecovery")</h2>
        </div>
    </div>
    <div class="window-content space password-recovery">
        @if (!String.IsNullOrEmpty(Model.Result) && Model.Found == true)
        {
            @Model.Result
        }
        else
        {
            if (!String.IsNullOrEmpty(Model.Result))
            {
                @Model.Result
            }
            using (Html.BeginForm())
            {
                @Html.ValidationSummary(false)
                <p class="tooltip">@T("Account.PasswordRecovery.Tooltip")</p>
                <div class="form-label">@Html.LabelFor(model => model.Email)</div>
                @Html.TextBoxFor(model => model.Email, new { @class = "email" })
                
                <div class="buttons password-submit">
                    <input type="submit" name="send-email" class="button-red password-recovery-button" value="@T("Account.PasswordRecovery.RecoverButton")" />
                </div>
            }
        }
    </div>
</div>
<script>
    $('.password-recovery-button').click(function () {
        $('.clicked').removeClass(".clicked").show();
        $('#ajax-loading-bar').hide();
        $(this).addClass("clicked");
        $('#ajax-loading-bar').show().css({
            "display": $(this).css("display"),
            "width": $(this).outerWidth(),
            "height": $(this).outerHeight(),
            "margin-top": $(this).css("margin-top"),
            "margin-bottom": $(this).css("margin-bottom"),
            "margin-left": $(this).css("margin-left"),
            "margin-right": $(this).css("margin-right")
        }).insertAfter($(this));
        $(this).hide();
    });
</script>
